package com.bao.system.controller;


import com.bao.response.Result;
import com.bao.system.entity.Department;
import com.bao.system.service.DepartmentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bao
 * @since 2021-06-04
 */
@RestController
@RequestMapping("/system/department")
//@CrossOrigin
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @GetMapping("/findDeptAndCount")
    @ApiOperation(value = "查询部门和人数",notes = "查询部门和人数")
    public Result findDeptAndCount(){
        List<Department> deptAndCount = departmentService.findDeptAndCount();
        return Result.ok().data("deptAndCount",deptAndCount);
    }
}

